"use strict";
// app.ts
App({
    globalData: {},
    onLaunch() {
        wx.getSystemInfo({
            success(res) {
                let safeArea = res.safeArea;
                let scale = res.windowWidth / 375;
                wx.setStorageSync("scale", scale); //px 换算rpx比例  					
                wx.setStorageSync("statusTop", safeArea.top); //状态栏高度  					
                wx.setStorageSync("headHei", safeArea.top + 44 * scale); //状态栏+导航栏高度
                wx.setStorageSync("bottom", res.screenHeight - safeArea.bottom); // 底部安全距离
                wx.setStorageSync("windowHeight", res.windowHeight); // 能够使用的窗口高度，不包含导航栏
            },
        });
        // 登录
        wx.login({
            success: res => {
                console.log(res.code);
                // 发送 res.code 到后台换取 openId, sessionKey, unionId
            },
        });
    },
});
